<template>
  <div :class="$style.panel">
    <div class="header-top" v-if="title"> 
      <div class="header" >
        <div class="title_box_">
          <div icon="el-icon-back" class="back-go" @click="goBack" v-if="useBack"><i class="el-icon-back"></i></div>
          <div class="box12">
            <div class="title">{{title}}</div>
            <div class="intro" v-if="intro">
              <el-tooltip placement="bottom-start">
                <div slot="content" v-html="intro.content"></div>
                <span   :class="$style.introntn" >查看本功能介绍文档</span>
              </el-tooltip>
            </div>
          </div>
        </div>
        <div class="head-right">
          <slot class="ext" name="ext" />
        </div>
    </div>
    
    </div>
    
    <div class="body">
        <slot name="body" />
    </div>
  </div>
</template>

<script>
export default {
  inject:['reload'],  //注入依赖
  props: {
    title: {
      type: String,
      default: ""
    },
    intro: {
      type: Object,
      default: () => {}
    },
    useBack: {
      type: Boolean,
      default: false
    }
  },
  data(){
    return {
      drawer: false,
      // intros: this.intro
    }
  },
  mounted(){
    // var bar_dv = this.$refs.desc;
    // bar_dv.html(intro.content)
  },
  methods: {
    goBack(){
      this.$router.go(-1)
    },
    refreshTab () {
      this.reload();
    },
  }
};
</script>
<style module lang='scss' scope>
// a {
//     color: #3a8ee6 !important; 
// }
.el-button{
    
  }
.panel {
  background: #ffffff;
  box-shadow: 0 5px 10px 0 rgba(170, 177, 183, 0.1);
  border-radius: 4px;
  margin-bottom: 20px;
  
  :global {
    
    .header {
      display: flex;
      flex-direction: row;
      flex-wrap: nowrap;
      justify-content: space-between;
      align-items: center;
      .back-go{
          border-radius: 6px;
          border: 1px solid #d5d5d5;
          display: flex;
          align-items: center;
          justify-content: center;
          color: #606266;
          height: 34px;
          width: 37px;
          margin-right: 10px;
        }
      .title_box_{
        display: flex;
        // flex-direction: column;
        .box12{
          display: flex;
        flex-direction: column;
        }
        button{
          padding: 10px;
          margin-right: 10px;
        }
      }
      
      .title {
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
      }
      .head-right{
        display: flex;
        .reshs {
          background-color: #67ca68;
          border-color: #67ca68;
        }
      }

      .ext {
        display: flex;
        align-items: center;
        :global(.el-range-separator) {
          padding: 0;
        }
        :global(.el-range__icon) {
          font-size: 14px !important;
        }
      }
    }
    .body {
      padding: 16px 20px;
    }
    .header-top{
      padding: 0 20px;
      border-bottom: 1px solid #e0e2e9;
      max-height: 70px;
      min-height: 46px;
      display: flex;
      flex-direction: column;
      justify-content: space-around;
      .intro{
        font-size: 13px;
        color: #a39f9f;
        line-height: 130%;
      }
    }
  }
}
.introntn {
  color: #969797;
  cursor: pointer;
}
</style>
